﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sgr.UPMS.Application.ViewModels
{
    /// <summary>
    /// 返回给前端的用户菜单视图模型
    /// </summary>
    public class OutUserMenuViewModel
    {
        /// <summary>
        /// 路由名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 路由路径
        /// </summary>
        public string? Path { get; set; }

        /// <summary>
        /// 组件
        /// </summary>
        public string? Component { get; set; }

        /// <summary>
        /// 重定向地址
        /// </summary>
        public string? Redirect { get; set; }

        /// <summary>
        /// 元数据信息
        /// </summary>
        public UserMenuMeta? Meta { get; set; }

        /// <summary>
        /// 子菜单列表
        /// </summary>
        public List<OutUserMenuViewModel>? Children { get; set; }
    }

    public class UserMenuMeta
    {
        /// <summary>
        /// 菜单标题（多语言）
        /// </summary>
        public Dictionary<string, string> Title { get; set; } = new Dictionary<string, string>();

        /// <summary>
        /// 菜单图标
        /// </summary>
        public string Icon { get; set; } = string.Empty;

        /// <summary>
        /// 外链地址
        /// </summary>
        public string? FrameSrc { get; set; }

        /// <summary>
        /// 是否在新窗口打开
        /// </summary>
        public bool? FrameBlank { get; set; }

        /// <summary>
        /// 是否固定
        /// </summary>
        public bool Affix { get; set; }
    }
}